The goal of this research is to understand the basic computational and control principles which the nervous system uses to generate functional behavior. Functional behavior emerges from a dynamical interaction between the nervous system, the body, and environment. The environment is, however, intrinsically variable and uncertain. Here it is proposed that, built into the dynamics of the basic behavior-generating structures of the nervous system and body, there is an internal dynamical model that predicts the environment and, automatically as behavior is generated, optimizes the behavior for that environment. A basic principle such as this can most clearly be revealed in a simple, experimentally tractable model system. This research will continue work with the central pattern generator (CPG) and the neuromuscular system that mediates rhythmic consummatory feeding behaviors in the marine mollusc Aplysia. Current data suggest that the dynamics of the CPG implement a two-component internal model of the animal's feeding environment. A slow component of the dynamics integrates sensory input over multiple cycles of behavior to estimate the most likely state of the environment in the next cycle. A fast component generates random variability that samples the region of uncertainty around this estimate. Both components are immediately expressed in the motor output. This research will combine experiments in the isolated CPG, reduced neuromuscular preparations, and intact animals, together with complementary theory and mathematical modeling, to examine how these dynamics of the motor output of the CPG, when interpreted by the dynamical properties of the neuromuscular system, then emerge in the functional behavior of the animal in different environments. The hypothesis will be tested that these mechanisms implement a strategy of action that guarantees optimal functional performance for the animal in an uncertain, variable environment. This overall aim will be accomplished by addressing the following specific questions. What are the dynamics of Aplysia feeding behavior in different feeding environments? What properties of the environment do these dynamics predict and optimize the behavior for? How are the dynamics generated by the CPG interpreted by the dynamics of the neuromuscular system? When the dynamics are perturbed, does the functional performance of the behavior degrade? When the environment changes, do the dynamics re-optimize for the new environment? The Aplysia system promises an integrated understanding of the functional role of such internal dynamical phenomena in motor networks, and in neural networks more generally, in an experimentally tractable system in which all components are relatively well known and open to inspection and manipulation. This research will expand our understanding of the basic principles of how the brain acts through the neuromuscular system to accomplish functional motor tasks, and how its ability to do so can be impaired, and might potentially be restored, in a variety of human diseases of neuromuscular coordination and in stroke.